<?php

$app = app();

$app->router->group([
    'namespace' => 'App\User\Controllers',
    'prefix' => '',
], function ($router) {
    $router->get('/', 'UserInfoController@index');
});

$app->router->group([
    'namespace' => 'App\User\Controllers',
    'prefix' => 'api',
], function ($router) {
    $router->post('/user/login', ['uses' => 'UserInfoController@miniProgLogin']);
    $router->group([
        'middleware' => ['miniprog.auth']
    ], function ($router) {
        $router->post('/user/logout', 'UserInfoController@logout');
        $router->get('/user/info', 'UserInfoController@info');
    });
});
